package operation;

import car.Cars;

public class Exit implements IOperation {
    private boolean flag = false;

    @Override
    public void work(Cars cars) {
        System.out.println("退出系统!!!");
        for (int i = 1; i <= 3; i++) {
            for (int j = 0; j < cars.getList(i).size(); j++) {
                cars.getList(i).set(j, null);
            }
        }
        flag = true;
        System.exit(0);
    }

    public boolean isFlag() {
        return flag;
    }
}
